#include <stdio.h>
#include <windows.h>
#define FNCCALL __stdcall
//#define FNCCALL __fastcall
//#define FNCCALL _cdecl 
namespace nkf32 { 
class DLLload_nkf32 {
HINSTANCE hd;
void   (FNCCALL* _GetNkfVersion)( LPSTR );
 int   (FNCCALL* _SetNkfOption)( LPSTR );
 void   (FNCCALL* _NkfConvert)( LPSTR , LPCSTR );
 void   (FNCCALL* _ToHankaku)( LPSTR );
 void   (FNCCALL* _ToZenkakuKana)( LPSTR , LPCSTR );
 void   (FNCCALL* _EncodeSubject)( LPSTR , LPCSTR );
 BOOL   (FNCCALL* _GetNkfVersionSafeA)( LPSTR , DWORD , LPDWORD );
 BOOL   (FNCCALL* _NkfConvertSafe)( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
 BOOL   (FNCCALL* _ToZenkakuKanaSafe)( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
 BOOL   (FNCCALL* _ToHankakuSafe)( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
 BOOL   (FNCCALL* _EncodeSubjectSafe)( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
 BOOL   (FNCCALL* _NkfFileConvert1SafeA)( LPCSTR , DWORD );
 BOOL   (FNCCALL* _NkfFileConvert2SafeA)( LPCSTR , DWORD , LPCSTR , DWORD );
 BOOL   (FNCCALL* _GetNkfGuessA)( LPSTR , DWORD , LPDWORD );
 BOOL   (FNCCALL* _GetNkfVersionSafeW)( LPWSTR , DWORD , LPDWORD );
 BOOL   (FNCCALL* _NkfFileConvert1SafeW)( LPCWSTR , DWORD );
 BOOL   (FNCCALL* _NkfFileConvert2SafeW)( LPCWSTR , DWORD , LPCWSTR , DWORD );
 BOOL   (FNCCALL* _GetNkfGuessW)( LPWSTR , DWORD , LPDWORD );
 BOOL   (FNCCALL* _GetNkfSupportFunctions)( void* , DWORD , LPDWORD );
 BOOL   (FNCCALL* _NkfUsage)( LPSTR , DWORD , LPDWORD );
 int   (FNCCALL* _NkfGetKanjiCode)(  );
friend int   NkfGetKanjiCode(  );
friend void   GetNkfVersion( LPSTR );
friend  int   SetNkfOption( LPSTR );
friend  void   NkfConvert( LPSTR , LPCSTR );
friend  void   ToHankaku( LPSTR );
friend  void   ToZenkakuKana( LPSTR , LPCSTR );
friend  void   EncodeSubject( LPSTR , LPCSTR );
friend  BOOL   GetNkfVersionSafeA( LPSTR , DWORD , LPDWORD );
friend  BOOL   NkfConvertSafe( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
friend  BOOL   ToZenkakuKanaSafe( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
friend  BOOL   ToHankakuSafe( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
friend  BOOL   EncodeSubjectSafe( LPSTR , DWORD , LPDWORD , LPCSTR , DWORD );
friend  BOOL   NkfFileConvert1SafeA( LPCSTR , DWORD );
friend  BOOL   NkfFileConvert2SafeA( LPCSTR , DWORD , LPCSTR , DWORD );
friend  BOOL   GetNkfGuessA( LPSTR , DWORD , LPDWORD );
friend  BOOL   GetNkfVersionSafeW( LPWSTR , DWORD , LPDWORD );
friend  BOOL   NkfFileConvert1SafeW( LPCWSTR , DWORD );
friend  BOOL   NkfFileConvert2SafeW( LPCWSTR , DWORD , LPCWSTR , DWORD );
friend  BOOL   GetNkfGuessW( LPWSTR , DWORD , LPDWORD );
friend  BOOL   GetNkfSupportFunctions( void* , DWORD , LPDWORD );
friend  BOOL   NkfUsage( LPSTR , DWORD , LPDWORD );
public:
DLLload_nkf32() {
 hd = LoadLibraryW(L"nkf32.dll");
 if(hd==NULL) { printf("nkf32.dll load err\n"); return; }
_GetNkfVersion = (void   (FNCCALL*)(LPSTR ) ) GetProcAddress( hd, "GetNkfVersion" );
_SetNkfOption = ( int   (FNCCALL*)(LPSTR ) ) GetProcAddress( hd, "SetNkfOption" );
_NkfConvert = ( void   (FNCCALL*)(LPSTR , LPCSTR ) ) GetProcAddress( hd, "NkfConvert" );
_ToHankaku = ( void   (FNCCALL*)(LPSTR ) ) GetProcAddress( hd, "ToHankaku" );
_ToZenkakuKana = ( void   (FNCCALL*)(LPSTR , LPCSTR ) ) GetProcAddress( hd, "ToZenkakuKana" );
_EncodeSubject = ( void   (FNCCALL*)(LPSTR , LPCSTR ) ) GetProcAddress( hd, "EncodeSubject" );
_GetNkfVersionSafeA = ( BOOL   (FNCCALL*)(LPSTR , DWORD , LPDWORD ) ) GetProcAddress( hd, "GetNkfVersionSafeA" );
_NkfConvertSafe = ( BOOL   (FNCCALL*)(LPSTR , DWORD , LPDWORD , LPCSTR , DWORD ) ) GetProcAddress( hd, "NkfConvertSafe" );
_ToZenkakuKanaSafe = ( BOOL   (FNCCALL*)(LPSTR , DWORD , LPDWORD , LPCSTR , DWORD ) ) GetProcAddress( hd, "ToZenkakuKanaSafe" );
_ToHankakuSafe = ( BOOL   (FNCCALL*)(LPSTR , DWORD , LPDWORD , LPCSTR , DWORD ) ) GetProcAddress( hd, "ToHankakuSafe" );
_EncodeSubjectSafe = ( BOOL   (FNCCALL*)(LPSTR , DWORD , LPDWORD , LPCSTR , DWORD ) ) GetProcAddress( hd, "EncodeSubjectSafe" );
_NkfFileConvert1SafeA = ( BOOL   (FNCCALL*)(LPCSTR , DWORD ) ) GetProcAddress( hd, "NkfFileConvert1SafeA" );
_NkfFileConvert2SafeA = ( BOOL   (FNCCALL*)(LPCSTR , DWORD , LPCSTR , DWORD ) ) GetProcAddress( hd, "NkfFileConvert2SafeA" );
_GetNkfGuessA = ( BOOL   (FNCCALL*)(LPSTR , DWORD , LPDWORD ) ) GetProcAddress( hd, "GetNkfGuessA" );
_GetNkfVersionSafeW = ( BOOL   (FNCCALL*)(LPWSTR , DWORD , LPDWORD ) ) GetProcAddress( hd, "GetNkfVersionSafeW" );
_NkfFileConvert1SafeW = ( BOOL   (FNCCALL*)(LPCWSTR , DWORD ) ) GetProcAddress( hd, "NkfFileConvert1SafeW" );
_NkfFileConvert2SafeW = ( BOOL   (FNCCALL*)(LPCWSTR , DWORD , LPCWSTR , DWORD ) ) GetProcAddress( hd, "NkfFileConvert2SafeW" );
_GetNkfGuessW = ( BOOL   (FNCCALL*)(LPWSTR , DWORD , LPDWORD ) ) GetProcAddress( hd, "GetNkfGuessW" );
_GetNkfSupportFunctions = ( BOOL   (FNCCALL*)(void* , DWORD , LPDWORD ) ) GetProcAddress( hd, "GetNkfSupportFunctions" );
_NkfUsage = ( BOOL   (FNCCALL*)(LPSTR , DWORD , LPDWORD ) ) GetProcAddress( hd, "NkfUsage" );
_NkfGetKanjiCode = ( int   (FNCCALL* )() )  GetProcAddress( hd, "NkfGetKanjiCode" );



}} _DLLload_nkf32 ;
int   NkfGetKanjiCode() { return _DLLload_nkf32._NkfGetKanjiCode(); }

void   GetNkfVersion(LPSTR  x0) { return _DLLload_nkf32._GetNkfVersion( x0); }
 int   SetNkfOption(LPSTR  x0) { return _DLLload_nkf32._SetNkfOption( x0); }
 void   NkfConvert(LPSTR  x0, LPCSTR  x1) { return _DLLload_nkf32._NkfConvert( x0,  x1); }
 void   ToHankaku(LPSTR  x0) { return _DLLload_nkf32._ToHankaku( x0); }
 void   ToZenkakuKana(LPSTR  x0, LPCSTR  x1) { return _DLLload_nkf32._ToZenkakuKana( x0,  x1); }
 void   EncodeSubject(LPSTR  x0, LPCSTR  x1) { return _DLLload_nkf32._EncodeSubject( x0,  x1); }
 BOOL   GetNkfVersionSafeA(LPSTR  x0, DWORD  x1, LPDWORD  x2) { return _DLLload_nkf32._GetNkfVersionSafeA( x0,  x1,  x2); }
 BOOL   NkfConvertSafe(LPSTR  x0, DWORD  x1, LPDWORD  x2, LPCSTR  x3, DWORD  x4) { return _DLLload_nkf32._NkfConvertSafe( x0,  x1,  x2,  x3,  x4); }
 BOOL   ToZenkakuKanaSafe(LPSTR  x0, DWORD  x1, LPDWORD  x2, LPCSTR  x3, DWORD  x4) { return _DLLload_nkf32._ToZenkakuKanaSafe( x0,  x1,  x2,  x3,  x4); }
 BOOL   ToHankakuSafe(LPSTR  x0, DWORD  x1, LPDWORD  x2, LPCSTR  x3, DWORD  x4) { return _DLLload_nkf32._ToHankakuSafe( x0,  x1,  x2,  x3,  x4); }
 BOOL   EncodeSubjectSafe(LPSTR  x0, DWORD  x1, LPDWORD  x2, LPCSTR  x3, DWORD  x4) { return _DLLload_nkf32._EncodeSubjectSafe( x0,  x1,  x2,  x3,  x4); }
 BOOL   NkfFileConvert1SafeA(LPCSTR  x0, DWORD  x1) { return _DLLload_nkf32._NkfFileConvert1SafeA( x0,  x1); }
 BOOL   NkfFileConvert2SafeA(LPCSTR  x0, DWORD  x1, LPCSTR  x2, DWORD  x3) { return _DLLload_nkf32._NkfFileConvert2SafeA( x0,  x1,  x2,  x3); }
 BOOL   GetNkfGuessA(LPSTR  x0, DWORD  x1, LPDWORD  x2) { return _DLLload_nkf32._GetNkfGuessA( x0,  x1,  x2); }
 BOOL   GetNkfVersionSafeW(LPWSTR  x0, DWORD  x1, LPDWORD  x2) { return _DLLload_nkf32._GetNkfVersionSafeW( x0,  x1,  x2); }
 BOOL   NkfFileConvert1SafeW(LPCWSTR  x0, DWORD  x1) { return _DLLload_nkf32._NkfFileConvert1SafeW( x0,  x1); }
 BOOL   NkfFileConvert2SafeW(LPCWSTR  x0, DWORD  x1, LPCWSTR  x2, DWORD  x3) { return _DLLload_nkf32._NkfFileConvert2SafeW( x0,  x1,  x2,  x3); }
 BOOL   GetNkfGuessW(LPWSTR  x0, DWORD  x1, LPDWORD  x2) { return _DLLload_nkf32._GetNkfGuessW( x0,  x1,  x2); }
 BOOL   GetNkfSupportFunctions(void*  x0, DWORD  x1, LPDWORD  x2) { return _DLLload_nkf32._GetNkfSupportFunctions( x0,  x1,  x2); }
 BOOL   NkfUsage(LPSTR  x0, DWORD  x1, LPDWORD  x2) { return _DLLload_nkf32._NkfUsage( x0,  x1,  x2); }
}
